package com.order.service.impl;

import com.order.dao.Dish;
import com.order.mapper.DishMapper;
import com.order.service.DishService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
@AllArgsConstructor
public class DishServiceImpl implements DishService {

    private DishMapper dishMapper;

    public int dishCount(Dish dish){
        return dishMapper.dishCount(dish);
    }

    public List<Dish> getDish(Map<String,Object> map){
        return dishMapper.getDish(map);
    }

    @Override
    public int addDish(Dish dish) {
        return dishMapper.addDish(dish);
    }

    @Override
    public int dishUpdate(Dish dish) {
        return dishMapper.dishUpdate(dish);
    }

    @Override
    public int dishDelete(int id) {
        return dishMapper.dishDelete(id);
    }

    @Override
    public List<Dish> dishSelect(Dish dish) {
        return dishMapper.dishSelect(dish);
    }

    @Override
    public Dish dishById(int id) {
        return dishMapper.dishById(id);
    }
}
